<?php

namespace app\tt\controller;

use think\Controller;
use app\common\aliyun;
use think\facade\Config;

class Oss extends Controller
{

    protected $middleware = [
        'app\http\middleware\checkTTUserToken::class'=>['only'=>['auth']]
    ];

    //获取阿里云文件上传的授权
    public function auth()
    {

        $this->result(aliyun\oss::getOssAuth(Config::get('oss.callback'),'tv/'),200,'授权签名成功');
    }

    //上传文件的回调
    public function callback(){
        $data= aliyun\oss::callback();
        return toResful('200', $data,'回调成功');
    }

}
